package com.transportation.app.location;

import android.location.Location;

public class GeoCalculator {

    public static double calculateDistance(double lat1, double lon1, double lat2, double lon2) {
        try {
            Location location1 = new Location("point1");
            Location location2 = new Location("point2");

            location1.setLatitude(lat1);
            location1.setLongitude(lon1);
            location2.setLatitude(lat2);
            location2.setLongitude(lon2);

            return location1.distanceTo(location2);
        } catch (Exception e) {
            return 0;
        }
    }
}